//
//  LookViewCollectionReusableView.m
//  Kugou-OC
//
//  Created by BH on 16/5/9.
//  Copyright © 2016年 Sunny. All rights reserved.
//

#import "LookViewCollectionReusableView.h"
#import "GlobalDefine.h"
#import "RightArrowButton.h"
#import <SDAutoLayout/UIView+SDAutoLayout.h>

@implementation LookViewCollectionReusableView

-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        UILabel *label = ALLOC(UILabel);
        label.text = @"演绎直播";
        label.font = TITLE_ONE_FONT;
        
        RightArrowButton *arrowBtn = ALLOC(RightArrowButton);
//        arrowBtn.titleLabel.textAlignment = NSTextAlignmentLeft;
        arrowBtn.titleLabel.font = TITLE_FOUR_FONT;
        [arrowBtn setTitleColor:TITLE_SECOND_TEXT_COLOR forState:UIControlStateNormal];
        [arrowBtn setImage:IMAGE(@"home_cell_arrow_left") forState:UIControlStateNormal];
        [arrowBtn setTitle:@"?位艺人在线" forState:UIControlStateNormal];
        
        UIImageView *lineVer = ALLOC(UIImageView);
        lineVer.image = IMAGE(@"line_short_bold_vertical");
        
        UIImageView *lineHor = ALLOC(UIImageView);
        lineHor.image = IMAGE(@"listen_horizon_long_line");
        
        UIButton *searchBtn = ALLOC(UIButton);
        [searchBtn setBackgroundImage:IMAGE(@"look_serch") forState:UIControlStateNormal];
        
        [self sd_addSubviews:@[label,arrowBtn,lineVer,lineHor,searchBtn]];
        
        label.sd_layout.leftSpaceToView(self,20).centerYEqualToView(self).autoHeightRatio(0).widthIs(80);
        searchBtn.sd_layout.rightSpaceToView(self,20).centerYEqualToView(self).widthIs(40).heightEqualToWidth();
        lineVer.sd_layout.rightSpaceToView(searchBtn,5).centerYEqualToView(self).heightIs(searchBtn.height).widthIs(1);
        arrowBtn.sd_layout.leftSpaceToView(label,0).centerYEqualToView(self).widthIs(100).heightIs(20);
        lineHor.sd_layout.leftEqualToView(label).rightEqualToView(searchBtn).bottomSpaceToView(self,1).heightIs(1);
    }
    
    return self;
}

@end
